package com.baidu.springboot_10_simpledemo.domain;

import java.io.Serializable;
import java.util.List;

/**
 * 分页对象，实现分页查询
 * 前端传入：currentPage 当前页码
 *          pageSize 每页显示多少条记录
 * 后端响应：totalCount 总记录数
 *          totalPage  总页码
 *          List<T> list 每页的数据
 */
public class PageBean<T> implements Serializable {
    private Integer totalPage;//总页码
    private Integer totalCount;//总记录数
    private Integer pageSize;//每页显示多少条记录
    private Integer currentPage;//当前页码
    private List<T> list;//每页的数据

    public Integer getTotalPage() {
        return totalPage;
    }

    public void setTotalPage(Integer totalPage) {
        this.totalPage = totalPage;
    }

    public Integer getTotalCount() {
        return totalCount;
    }

    public void setTotalCount(Integer totalCount) {
        this.totalCount = totalCount;
    }

    public Integer getPageSize() {
        return pageSize;
    }

    public void setPageSize(Integer pageSize) {
        this.pageSize = pageSize;
    }

    public Integer getCurrentPage() {
        return currentPage;
    }

    public void setCurrentPage(Integer currentPage) {
        this.currentPage = currentPage;
    }

    public List<T> getList() {
        return list;
    }

    public void setList(List<T> list) {
        this.list = list;
    }

    @Override
    public String toString() {
        return "PageBean{" +
                "totalPage=" + totalPage +
                ", totalCount=" + totalCount +
                ", pageSize=" + pageSize +
                ", currentPage=" + currentPage +
                ", list=" + list +
                '}';
    }
}
